import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;


public class MangaPage {
	
	Document mangaPageUrl(Connection connex){
		connex.timeout(30000);
		Document res = new Document("");
		try {
			Document res0 = connex.get();
			res=res0;
		} catch(Exception e){System.out.println("L'URL utilisée est inaccessible");}
		return res;
		
	}
	
	String mangaPageNumber;
	String volumeNumber;
	//Chapter parentChapter;
	String pageImageUrl;
	
	MangaPage (String url){
		Connection mangaPageConnection = Jsoup.connect(url);
		Element divViewer = mangaPageUrl(mangaPageConnection).getElementById("viewer");
		Element divTitle = mangaPageUrl(mangaPageConnection).getElementById("series");
		
		pageImageUrl = divViewer.child(0).child(0).attr("src");
		mangaPageNumber = divTitle.child(2).text();
		volumeNumber = divTitle.child(1).text();
	}
		
}


